﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;
//using Oracle.DataAccess.Client;
using System.Configuration;
//using System.Data.Entity.Infrastructure;
using System.ComponentModel.DataAnnotations;
using DslamPort.Models;
using System.Collections.ObjectModel;
using System.Web.Mvc;
using System.Data.OracleClient;
using System.IO;
using System.Data;

namespace DslamPort.Models
{
    public class ServiceType
    {

        public int loai_dv_id { get; set; }
        public string ten_dv { get; set; }
        public List<ServiceType> getDv(string option)
        {
            string sql = "";
            if (option == "4")
                sql = "select * from loai_tb_int where dichvu_id=4";
            if (option == "16")
                sql = "select * from loai_tb_mytv";
            List<ServiceType> DV_ = new List<ServiceType>();
            var odr = BaseClass.Lib_GetDataReader(sql);
            foreach (DataRow item in odr.Rows)
            {
                DV_.Add(new ServiceType
                {
                    loai_dv_id = Convert.ToInt32(item["loai_tb_id"].ToString()),
                    ten_dv = item["ten"].ToString()

                });

            }
            return DV_;
        }

    }
}
